<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/html/js/axios.min.js"></script>
    <script src="/html/js/util.js"></script>
    <script>
        window.onload = function (){
            init(1);
        }

        async function init(pageNO){
            let info = await ajaxGet("/user/findByItem",{pageNo:pageNO});
            let str = "";
            for(let i=0;i<info.list.length;i++){
                let obj = info.list[i];
                str += `<tr><td>${obj.name}</td>
                        <td>${obj.sex}</td>
                        <td>${obj.money}</td>
                        <td>${obj.birthday}</td></tr>`;
            }
            $("data").innerHTML = str;

            let cut = "";
            for(let i=1;i<=info.pages;i++){
                cut += `<a style="margin-left: 10px" href="javascript:init(${i})">${i}</a>`
            }

            $("cutDiv").innerHTML = cut;
        }
    </script>
</head>
<body>
<table border="1" cellspacing="0" width="50%">
    <thead><tr><th>用户名</th><th>性别</th><th>工资</th><th>生日</th></tr></thead>
    <tbody id="data"></tbody>
</table>
<div id="cutDiv"></div>
<a href="/html/add.html">添加用户</a>
</body>
</html>